package test;

import java.util.Scanner;

public class LoL {
    String name="STEAM";
    String dizhi="xxx-xxx-xx";
    String menu="evergame";
    String call="+xx-xxxxxxx";
    int cishu;
    String [] ren=new String[20];
    public void xinxi(){
        System.out.println("公司名称是 "+name+"     地址是 "+dizhi+"    项目是 "+menu+"    电话是 "+call);
    }
    public void join(){
        Scanner in = new Scanner(System.in);
        int x=cishu;
        for (; x < ren.length; x++) {
            System.out.println("输入名字");
            String minzi=in.next();
            if(ren[x].equals(minzi)){
                System.out.println("no");
                return;
            }
            if(ren[x]==null){
                ren[x]=minzi;
                cishu++;
                System.out.println("OK");
                return;
            }
            System.out.println("Sorry");
        }

    }
    public void chakan(){
        System.out.println("现在有员工"+cishu+"个");
        for (int x=0;x<cishu;x++){
            System.out.print(ren[x]+" ");
        }
        System.out.println();
    }
    public void chazhao(){
        Scanner in = new Scanner(System.in);
        System.out.println("输入名字");
        String id=in.next();
        if(cishu<0){
            System.out.println("还没有人-.-先去招人吧");
        }
        for (int x=0;x<ren.length;x++){
            if(ren[x].equals(id)){
                System.out.println("找的是"+(x+1)+"号"+id);
                return;
            }
            System.out.println("没有"+id);

        }
    }
    public void chazhao2(){
        Scanner in = new Scanner(System.in);
        System.out.println("输入序号");
        int id2=in.nextInt();
        if(cishu<0){
            System.out.println("还没有人-.-先去招人吧");
        }
        for (int x=0;x<ren.length;x++){
            if((id2-1)==x){
                System.out.println(id2+"号员工是"+ren[x]);
                return;
            }
            System.out.println("404!");

        }
    }
    public void xiugai(){
        Scanner in = new Scanner(System.in);
        System.out.println("现在有员工"+cishu+"个");
        for (int x=0;x<cishu;x++){
            System.out.print(ren[x]+" ");
        }
        System.out.println("输入要修改的员工序号");
        int xg=in.nextInt();
        for (int x=0;x<ren.length;x++){
            System.out.println("输入新的名字");
            String id3=in.next();
            if(ren[xg-1].equals(id3)){
                System.out.println("no");
                break;
            }
            ren[xg-1]=id3;
            break;
        }
    }
    public void shanchu(){
        Scanner in = new Scanner(System.in);
        System.out.println("现在有员工"+cishu+"个");
        for (int x=0;x<cishu;x++){
            System.out.print(ren[x]+" ");
        }
        System.out.println("你不要哪一个");
        int s=in.nextInt();
        if (s<0 || s>cishu){
            System.out.println("no");
            return;
        }
        ren[s-1]=ren[s];
        cishu--;
        return;

    }
}